<?php
class View_Attribute extends View_Admin_Index_Template  {
	public $oTemp;
	public function __construct($oModel){
		parent::__construct($oMode);
	}
	public function displayManagerIndex($oModel){
		$this->initTemplate($oModel);
		$this->oTemp->assign_file( 'tempMainContent', PATH_TEMPLATE_ADMIN.'html/attribute_index.html' );	
		$this->oTemp->assign_file( 'search_and_filter_block', PATH_TEMPLATE_ADMIN.'html/filter_block.html' );	
		$this->oTemp->assign('pageHeding',$oModel->aLanguage[MODULE_HEADING]['product_detail']);
		/**
		 * toolbar setup
		 */
		$this->oTemp->assign('toobar_new','?sMod=attribute.index&sAction=add_form');
		
		$this->oTemp->parse('main.toobar_new');
	}
	public function displayListAttribute($oModel){
		$arrayListAttribute = $oModel->getdataAttribute();
		//print_r($arrayListAttribute);
		if (is_array($arrayListAttribute)) 
			foreach ($arrayListAttribute as $itemAtt)
			{		 
				$this->oTemp->assign("rowAtt",$itemAtt);
				$this->oTemp->parse('main.LIST_ATT.rowAtt');
			}
			$this->oTemp->parse('main.LIST_ATT');
	}
	
	public function displayInfoAttribute_update($oModel){
		
	
		$this->oTemp->assign("sAction",'edit_form');
		$rowAttribute = $oModel->getInfoAttribute();
		if (is_array($rowAttribute)) 
		//print_r($rowAttribute);
			foreach ($rowAttribute as $itemAtt)
			{		 
				$this->oTemp->assign("at_name",$itemAtt['at_name']);
				$this->oTemp->assign("at_content",$itemAtt['at_content']);
				if ($itemAtt['at_status']==1)
				{
				$this->oTemp->assign("at_status",'checked="checked"');
				}
				else
				{
					$this->oTemp->assign("at_status",'');
				}
				//$this->oTemp->parse('main.LIST.rowAtt');
			}		
			$this->oTemp->parse('main.LIST');	
	}
	public function displayInforAttribute_insert($oModel)
	{
		$this->oTemp->assign("at_status",'checked="checked"');
		$this->oTemp->assign("sAction",'add_form');
		$this->oTemp->parse('main.LIST');
	}
}
?>